﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for CarInsuranceCompletedItemDB
/// </summary>
/// 
namespace CE.CarInsurance
{
    public class CarInsuranceCompletedItemDB
    {
        public CarInsuranceCompletedItemDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public DataSet GetCarInsuranceCompletedItem(Int64 CarId, Int64 ProviderCompanyId)
        {
            DataSet _result = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocCarInsuranceTHCompletedItem";

            SortedList _spara = new SortedList();
            _spara.Add("@CarId", CarId);
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);


            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables.Count > 0 && _ds.Tables[0].Rows.Count > 0)
                {
                    _result = _ds;
                }
            }
            return _result;
        }

        public DataSet GetCRMCompletedItem(Int64 UserId)
        {
            DataSet _result = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocUserResultNonGGSelectSingleItem";

            SortedList _spara = new SortedList();
            _spara.Add("@RefCEUserId", UserId);


            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables.Count > 0 && _ds.Tables[0].Rows.Count > 0)
                {
                    _result = _ds;
                }
            }
            return _result;
        }

    }
}